<template>
  <div>
    <Header :currentCity="currentCity" :cityList="cityList"></Header>
    <Crumb :crumbListData="crumbListData"></Crumb>
    <div class="content-row">
      <div class="content-row-center">
        <div class="screen-box">
          <!-- 位置 -->
          <div class="screen-row">
            <div class="screen-title">位置：</div>
            <div class="screen-item">
              <ul class="screen-ul">
                <li class="arrow">
                  <a
                    href="javascript:void(0);"
                    :class="positionMenu == 0 ? 'checked' : ''"
                    @click="positionMenu = 0"
                  >区域找房</a>
                </li>
                <li class="arrow">
                  <a
                    href="javascript:void(0);"
                    :class="positionMenu == 1 ? 'checked' : ''"
                    @click="positionMenu = 1"
                  >地铁找房</a>
                </li>
              </ul>
              <div v-show="positionMenu == 0">
                <!-- 区域 -->
                <div class="screen-subitem">
                  <ul class="screen-ul">
                    <li v-for="(item, index) in regionList" :key="index">
                      <a
                        :href="prefixUrl + item.href"
                        :data-aliases="item.aliases"
                        :class="
                          setChecked(splitPageUrlArr, item.aliases)
                            ? 'checked'
                            : ''
                        "
                        :title="item.shortName"
                      >{{ item.shortName }}</a>
                    </li>
                  </ul>
                </div>
                <!-- 街道 -->
                <div class="screen-subitem">
                  <ul class="screen-ul">
                    <li v-for="(item, index) in streetList" :key="index">
                      <a
                        :href="prefixUrl + item.href"
                        :data-aliases="item.aliases"
                        :class="
                          setChecked(splitPageUrlArr, item.aliases)
                            ? 'checked'
                            : ''
                        "
                        :title="item.name"
                      >
                        <span class="checkbox"></span>
                        <span class="checkbox-text">{{ item.name }}</span>
                      </a>
                    </li>
                  </ul>
                </div>
              </div>
              <div v-show="positionMenu == 1">
                <!-- 地铁 -->
                <div class="screen-subitem">
                  <ul class="screen-ul">
                    <li v-for="(item, index) in metroList" :key="index">
                      <a
                        :href="prefixUrl + item.href"
                        :data-aliases="item.aliases"
                        :class="
                          setChecked(splitPageUrlArr, item.aliases)
                            ? 'checked'
                            : ''
                        "
                      >{{ item.lineName }}</a>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
          <!-- 价格 -->
          <div class="screen-row">
            <div class="screen-title">单价：</div>
            <div class="screen-item">
              <ul class="screen-ul">
                <li v-for="(item, index) in priceList" :key="index">
                  <a
                    :href="prefixUrl + item.href"
                    :data-aliases="item.aliases"
                    :class="
                      setChecked(splitPageUrlArr, item.aliases) ? 'checked' : ''
                    "
                  >{{ item.name }}</a>
                </li>
              </ul>
            </div>
          </div>
          <!-- 总价 -->
          <div class="screen-row">
            <div class="screen-title">总价：</div>
            <div class="screen-item">
              <ul class="screen-ul">
                <li v-for="(item, index) in priceTotalList" :key="index">
                  <a
                    :href="prefixUrl + item.href"
                    :data-aliases="item.aliases"
                    :class="
                      setChecked(splitPageUrlArr, item.aliases) ? 'checked' : ''
                    "
                  >{{ item.name }}</a>
                </li>
              </ul>
            </div>
          </div>
          <!-- 户型 -->
          <div class="screen-row">
            <div class="screen-title">户型：</div>
            <div class="screen-item">
              <ul class="screen-ul">
                <li v-for="(item, index) in houseTypeList" :key="index">
                  <a
                    :href="prefixUrl + item.href"
                    :class="
                      setChecked(splitPageUrlArr, item.aliases) ? 'checked' : ''
                    "
                  >
                    <span class="checkbox"></span>
                    <span class="checkbox-text">{{ item.name }}</span>
                  </a>
                </li>
              </ul>
            </div>
          </div>
          <!-- 面积 -->
          <div class="screen-row">
            <div class="screen-title">面积：</div>
            <div class="screen-item">
              <ul class="screen-ul">
                <li v-for="(item, index) in areaList" :key="index">
                  <a
                    :href="prefixUrl + item.href"
                    :class="
                      setChecked(splitPageUrlArr, item.aliases) ? 'checked' : ''
                    "
                  >
                    <span class="checkbox"></span>
                    <span class="checkbox-text">{{ item.name }}</span>
                  </a>
                </li>
              </ul>
            </div>
          </div>
          <div class="screen-more" v-show="more.show">
            <!-- 销售状态 -->
            <div class="screen-row">
              <div class="screen-title">销售状态：</div>
              <div class="screen-item">
                <ul class="screen-ul">
                  <li v-for="(item, index) in saleStateList" :key="index">
                    <a
                      :href="prefixUrl + item.href"
                      :data-aliases="item.aliases"
                      :class="
                        setChecked(splitPageUrlArr, item.aliases)
                          ? 'checked'
                          : ''
                      "
                    >{{ item.name }}</a>
                  </li>
                </ul>
              </div>
            </div>
            <!-- 物业类型 -->
            <div class="screen-row">
              <div class="screen-title">物业类型：</div>
              <div class="screen-item">
                <ul class="screen-ul">
                  <li v-for="(item, index) in propertyTypeList" :key="index">
                    <a
                      :href="prefixUrl + item.href"
                      :data-aliases="item.aliases"
                      :class="
                        setChecked(splitPageUrlArr, item.aliases)
                          ? 'checked'
                          : ''
                      "
                    >{{ item.name }}</a>
                  </li>
                </ul>
              </div>
            </div>
            <!-- 开盘时间 -->
            <div class="screen-row">
              <div class="screen-title">开盘时间：</div>
              <div class="screen-item">
                <ul class="screen-ul">
                  <li v-for="(item, index) in openingTimeList" :key="index">
                    <a
                      :href="prefixUrl + item.href"
                      :data-aliases="item.aliases"
                      :class="
                        setChecked(splitPageUrlArr, item.aliases)
                          ? 'checked'
                          : ''
                      "
                    >{{ item.name }}</a>
                  </li>
                </ul>
              </div>
            </div>
            <!-- 装修状况 -->
            <div class="screen-row">
              <div class="screen-title">装修状况：</div>
              <div class="screen-item">
                <ul class="screen-ul">
                  <li v-for="(item, index) in renovationList" :key="index">
                    <a
                      :href="prefixUrl + item.href"
                      :data-aliases="item.aliases"
                      :class="
                        setChecked(splitPageUrlArr, item.aliases)
                          ? 'checked'
                          : ''
                      "
                    >{{ item.name }}</a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
          <!-- 更多 收起 -->
          <!-- <div class="more-center">
            <el-divider>
              <a
                href="javascript:void(0);"
                @click="moreChange"
                class="more-title"
                >{{ more.title }}<i :class="more.icon"></i
              ></a>
            </el-divider>
          </div>-->
          <!-- 已筛选条件 -->
          <div class="screened-row">
            <dt class="screened-dt">已筛选条件：</dt>
            <dd class="screened-dd">
              <a v-for="item,index in screenedData" :key="index" :href="item.href">{{item.name}}</a>
            </dd>
          </div>
          <!-- 楼盘列表 -->
          <div class="real-estate-row">
            <!-- 楼盘 -->
            <div class="real-estate-center">
              <div class="real-estate-tab">
                <a
                  class="tab-link"
                  v-for="(item, index) in realEstateTypeData"
                  :key="index"
                  :href="prefixUrl + item.href"
                  :data-aliases="item.aliases"
                  :class="realEstateTypeChecked == item.aliases ? 'active' : ''"
                >{{ item.name }}</a>
              </div>
              <div class="real-estate-desc">
                <p class="desc-notice">
                  共找到
                  <strong style="color: #ef524d; font-size: 16px">
                    {{
                    total
                    }}
                  </strong>个符合条件的楼盘
                </p>
                <ul class="desc-ul">
                  <li v-for="(item, index) in realEstateSortData" :key="index">
                    <a
                      class="desc-link"
                      :href="prefixUrl + item.href"
                      :class="
                        realEstateSortChecked == item.aliases ? 'active' : ''
                      "
                    >{{ item.name }}</a>
                  </li>
                </ul>
              </div>
              <listRow :listData="listData" :jump="`${prefixUrl}/lpxq`"></listRow>
              <!-- 空数据 -->
              <el-empty description="没有找到你想要的楼盘" v-if="empty"></el-empty>
            </div>
            <!-- 榜单 -->
            <div class="billboard-row">
              <!-- 人气榜 -->
              <div class="billboard-list">
                <div class="billboard-list-title">
                  <strong class="list-title">人气榜</strong>
                </div>
                <div class="billboard-list-item">
                  <adList :listData="popularityListData" :jump="`${prefixUrl}/lpxq`"></adList>
                </div>
              </div>
              <!-- 热议榜 -->
              <div class="billboard-list">
                <div class="billboard-list-title">
                  <strong class="list-title">热议榜</strong>
                </div>
                <div class="billboard-list-item">
                  <adList :listData="hotDiscussionListData" :jump="`${prefixUrl}/lpxq`"></adList>
                </div>
              </div>
              <!-- 销售榜 -->
              <div class="billboard-list">
                <div class="billboard-list-title">
                  <strong class="list-title">销售榜</strong>
                </div>
                <div class="billboard-list-item">
                  <adList :listData="saleListData" :jump="`${prefixUrl}/lpxq`"></adList>
                </div>
              </div>
            </div>
          </div>
          <!-- 分页 -->
          <div class="page-row" v-show="!empty">
            <el-pagination
              class="page-list"
              background
              :current-page="pageNum"
              :page-size="pageSize"
              :total="total"
              layout="prev, pager, next"
              hide-on-single-page
              @current-change="pageChange"
            ></el-pagination>
          </div>
        </div>
        <!-- 猜你喜欢 -->
        <div class="row row-v52 clearfix">
          <div class="box2 box-inter-52 has-marginTop box-inter">
            <div class="hd">
              <h2>猜你喜欢</h2>
            </div>
            <div class="bd">
              <likeList :listData="likeListData" :jump="`${prefixUrl}/lpxq`"></likeList>
            </div>
          </div>
        </div>
        <!-- 楼盘分类 -->
        <div class="lpfl-row">
          <ul class="lpfl-ul">
            <li class="lpfl-li" v-for="item,index in lpflData" :key="index">
              <span class="letter" @mouseover="lpflIndex=index" :class="lpflIndex==index?'on':''">{{item.letter}}</span>
              <div class="children" v-show="lpflIndex==index">
                <a v-for="ite,ind in item.letterList" :key="ind" :href="`${prefixUrl}/lpxq/${ite.estateId}.html`" :title="ite.name" v-show="ind < 8" target="_blank">{{ite.name}}楼盘</a>
                <a :href="`${prefixUrl}/loupan/${item.letter}`">更多楼盘&gt;&gt;</a>
              </div>
            </li>
          </ul>
        </div>
        <!-- 关键区域，街道，周边 -->
        <keywordBox :currentCity="currentCity" :prefixUrl="prefixUrl" :regionList="regionList" :streetList="streetList" :splitPageUrlArr="splitPageUrlArr"></keywordBox>
      </div>
    </div>
    <Footer :currentCity="currentCity"></Footer>
  </div>
</template>

<script>
import u from '@/plugins/Ccom'
import listRow from '@/components/list-row'
import adList from '@/components/ad-list'
import likeList from '@/components/like-list'
var head = {
  title: '',
  content: '',
  keywords: '',
}
export default {
  components: {
    listRow,
    adList,
    likeList,
  },
  head() {
    return {
      title: head.title,
      meta: [
        { name: 'keywords', content: head.keywords },
        { name: 'description', content: head.content },
      ],
      link: [{ rel: 'stylesheet', href: '/css/lpcx.css' }],
    }
  },
  data() {
    return {
      more: {
        show: true,
        title: '更多',
        icon: 'el-icon-arrow-down',
      },
      lpflIndex: 0,
    }
  },
  async asyncData(ctx) {
    var prefixUrl = ctx.prefixUrl
    var currentCity = ctx.currentCity
    var cityList = ctx.cityList
    var crumbListData = []
    var verifySearchLabel = /^\o\d+$/.test(ctx.params.search) // 验证 搜索楼盘标签参数
    var labStr = verifySearchLabel ? ctx.params.search : '' // 楼盘标签参数
    var positionMenu = 0 // 区域与地铁的切换
    var splitPageUrl = ctx.params.search ? ctx.params.search.split('-') : [] // 拆分页面路径 '-'
    var cityCode = ctx.currentCity.cityCode || '' // 城市code
    var pageNum = 1 // 当前页
    var pageSize = 20 // 每页显示几条
    var regionList = [] // 区域数据
    var streetList = [] // 街道数据
    var metroList = [] // 地铁数据
    var priceList = [] // 单价数据
    var priceTotalList = [] // 总价数据
    var houseTypeList = [] // 户型数据
    var areaList = [] // 面积数据
    var saleStateList = [] // 销售状态数据
    var propertyTypeList = [] // 物业类型数据
    var openingTimeList = [] // 开盘时间数据
    var renovationList = [] // 装修状况数据
    var popularityListData = [] // 人气榜
    var hotDiscussionListData = [] // 热议榜
    var saleListData = [] // 销售榜
    var likeListData = [] // 猜你喜欢
    var realEstateTypeData = [
      {
        name: '全部楼盘',
        aliases: 'm0',
      },
      {
        name: '优惠楼盘',
        aliases: 'm1',
      },
    ] // 全部楼盘 优惠楼盘
    var realEstateSortData = [
      {
        name: '综合排序',
        aliases: 'n0',
      },
      {
        name: '单价升序',
        aliases: 'n1',
      },
      {
        name: '开盘时间',
        aliases: 'n2',
      },
    ] // 楼盘列表排序
    var total = 0 // 总条数
    var listData = [] // 楼盘数据
    var splitDitieUrl = [] // 拆分地铁路径
    var splitQuyuUrl = [] // 拆分区域路径
    var splitJiedaoUrl = [] // 拆分街道路径
    var splitDanjiaUrl = [] // 拆分单价路径
    var splitZongjiaUrl = [] // 拆分总价路径
    var splitHuxingUrl = [] // 拆分户型路径
    var splitMianjiUrl = [] // 拆分面积路径
    var splitXiaoshouzhuangtaiUrl = [] // 拆分销售状态路径
    var splitWuyeleixingUrl = [] // 拆分物业类型路径
    var splitKaipanshijianUrl = [] // 拆分开盘时间路径
    var splitZhuangxiuzhuangkuangUrl = [] // 拆分装修状况路径
    var splitLoupanleixingUrl = [] // 拆分全部楼盘 优惠楼盘路径
    var splitLoupanpaixuUrl = [] // 拆分楼盘排序路径
    var splitFenyeUrl = [] // 拆分分页
    var splitPageUrlArr = [] // 页面路径拆分新数组
    var realEstateTypeChecked = 'm0' // 选中楼盘类型下标
    var realEstateSortChecked = 'n0' // 选中楼盘排序值
    var searchName = ctx.query.kwname ? `?kwname=${ctx.query.kwname}` : '' // 搜索参数
    var headDitieName = '' // seo 地铁
    var headQuyuName = '' // seo 区域
    var headJiedaoName = '' // seo 街道
    var headDanjiaName = '' // seo 单价
    var headZongjiaName = '' // seo 总价
    var headHuxingName = '' // seo 户型
    var headMianjiName = '' // seo 面积
    var headXiaoshouzhuangtaiName = '' // seo 销售状态
    var headWuyeleixingName = '' // seo 物业类型
    var headKaipanshijianName = '' // seo 开盘时间
    var headZhuangxiuzhuangkuangName = '' // seo 装修状况
    var empty = false
    var screenedData = [] // 已筛选条件
    var lpflData = [] // 底部楼盘分类数据

    // 拆分页面路径 '_'
    splitPageUrl.forEach((item) => {
      switch (item.charAt(0)) {
        case 'b': // 地铁
          splitDitieUrl = item.split('_') || []
          break
        case 'c': // 区域
          splitQuyuUrl = item.split('_') || []
          break
        case 'd': // 街道
          splitJiedaoUrl = item.split('_') || []
          break
        case 'e': // 单价
          splitDanjiaUrl = item.split('_') || []
          break
        case 'f': // 总价
          splitZongjiaUrl = item.split('_') || []
          break
        case 'g': // 户型
          splitHuxingUrl = item.split('_') || []
          break
        case 'h': // 面积
          splitMianjiUrl = item.split('_') || []
          break
        case 'i': // 销售状态
          splitXiaoshouzhuangtaiUrl = item.split('_') || []
          break
        case 'j': // 物业类型
          splitWuyeleixingUrl = item.split('_') || []
          break
        case 'k': // 开盘时间
          splitKaipanshijianUrl = item.split('_') || []
          break
        case 'l': // 装修状况
          splitZhuangxiuzhuangkuangUrl = item.split('_') || []
          break
        case 'm': // 全部楼盘 优惠楼盘
          splitLoupanleixingUrl = item.split('_') || []
          break
        case 'n': // 楼盘排序
          splitLoupanpaixuUrl = item.split('_') || []
          break
        case 'p': // 分页
          splitFenyeUrl = item.split('_') || []
          break
      }
    })

    // 设置路径
    function setHref(obj) {
      let nowHref = '' // 新路径
      let nowArr = [] // 新拼接数组
      // 拼接地铁线
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'b') {
        // 没有地铁参数 添加当前地铁参数
        let nowSplitDitieUrl = obj.aliases != 'b0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          nowSplitDitieUrl,
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接区域路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'c') {
        // 没有区域参数 添加当前区域参数
        let nowSplitQuyuUrl = obj.aliases != 'c0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          nowSplitQuyuUrl,
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接街道路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'd') {
        // 替换摘除不需要的组合
        let splitJiedaoUrlStr = splitJiedaoUrl.join('_')
        let nowSplitJiedaoUrlStr = ''
        if (splitJiedaoUrlStr.indexOf(obj.aliases) > -1) {
          // 当前别名参数在页面路径上存在 替换为空
          let splitJiedaoUrlStr1 = splitJiedaoUrlStr.replace(obj.aliases, '')
          splitJiedaoUrlStr1 = splitJiedaoUrlStr1.split('_')
          splitJiedaoUrlStr1 = u.emptyArrayIsNull(splitJiedaoUrlStr1)
          nowSplitJiedaoUrlStr = splitJiedaoUrlStr1.join('_')
        } else {
          // 当前别名参数在页面路径上不存在 末尾追加
          nowSplitJiedaoUrlStr = splitJiedaoUrlStr
            ? `${splitJiedaoUrlStr}_${obj.aliases}`
            : obj.aliases
        }
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitQuyuUrl,
          nowSplitJiedaoUrlStr,
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接单价路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'e') {
        // 重新赋值
        let nowSplitDanjiaUrl = obj.aliases != 'e0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          nowSplitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接总价路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'f') {
        // 重新赋值
        let nowSplitZongjiaUrl = obj.aliases != 'f0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          nowSplitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接户型路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'g') {
        // 替换摘除不需要的组合
        let splitHuxingUrlStr = splitHuxingUrl.join('_')
        let nowSplitHuxingUrlStr = ''
        if (splitHuxingUrlStr.indexOf(obj.aliases) > -1) {
          // 当前别名参数在页面路径上存在 替换为空
          let splitHuxingUrlStr1 = splitHuxingUrlStr.replace(obj.aliases, '')
          splitHuxingUrlStr1 = splitHuxingUrlStr1.split('_')
          splitHuxingUrlStr1 = u.emptyArrayIsNull(splitHuxingUrlStr1)
          nowSplitHuxingUrlStr = splitHuxingUrlStr1.join('_')
        } else {
          // 当前别名参数在页面路径上不存在 末尾追加
          nowSplitHuxingUrlStr = splitHuxingUrlStr
            ? `${splitHuxingUrlStr}_${obj.aliases}`
            : obj.aliases
        }
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          nowSplitHuxingUrlStr,
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接面积路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) == 'h') {
        // 替换摘除不需要的组合
        let splitMianjiUrlStr = splitMianjiUrl.join('_')
        let nowSplitMianjiUrlStr = ''
        if (splitMianjiUrlStr.indexOf(obj.aliases) > -1) {
          // 当前别名参数在页面路径上存在 替换为空
          let splitMianjiUrlStr1 = splitMianjiUrlStr.replace(obj.aliases, '')
          splitMianjiUrlStr1 = splitMianjiUrlStr1.split('_')
          splitMianjiUrlStr1 = u.emptyArrayIsNull(splitMianjiUrlStr1)
          nowSplitMianjiUrlStr = splitMianjiUrlStr1.join('_')
        } else {
          // 当前别名参数在页面路径上不存在 末尾追加
          nowSplitMianjiUrlStr = splitMianjiUrlStr
            ? `${splitMianjiUrlStr}_${obj.aliases}`
            : obj.aliases
        }
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          nowSplitMianjiUrlStr,
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接销售状态路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'i') {
        let nowSplitXiaoshouzhuangtaiUrl =
          obj.aliases != 'i0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          nowSplitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接物业类型路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'j') {
        let nowSplitWuyeleixingUrl = obj.aliases != 'j0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          nowSplitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接开盘时间路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'k') {
        let nowSplitKaipanshijianUrl = obj.aliases != 'k0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          nowSplitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接装修状况路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'l') {
        let nowSplitZhuangxiuzhuangkuangUrl =
          obj.aliases != 'l0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          nowSplitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接全部楼盘 优惠楼盘路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'm') {
        let nowSplitLoupanleixingUrl = obj.aliases != 'm0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          nowSplitLoupanleixingUrl,
          splitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接楼盘排序路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'n') {
        let nowSplitLoupanpaixuUrl = obj.aliases != 'n0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          nowSplitLoupanpaixuUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      // 拼接分页路径
      if (!u.empty(obj.aliases) && obj.aliases.charAt(0) === 'p') {
        let nowSplitFenyeUrl = obj.aliases != 'p0' ? [obj.aliases] : []
        // 数组重新组合
        let nowSplitUrl = nowArr.concat(
          splitDitieUrl,
          splitQuyuUrl,
          splitJiedaoUrl.join('_'),
          splitDanjiaUrl,
          splitZongjiaUrl,
          splitHuxingUrl.join('_'),
          splitMianjiUrl.join('_'),
          splitXiaoshouzhuangtaiUrl,
          splitWuyeleixingUrl,
          splitKaipanshijianUrl,
          splitZhuangxiuzhuangkuangUrl,
          splitLoupanleixingUrl,
          splitLoupanpaixuUrl,
          nowSplitFenyeUrl
        )
        u.emptyArrayIsNull(nowSplitUrl) // 清除空数据
        nowHref = nowSplitUrl.join('-') + searchName
      }

      return `/lpcx/${nowHref}`
    }

    // 将页面路劲参数全部拆分
    splitPageUrlArr = splitPageUrlArr.concat(
      splitDitieUrl,
      splitQuyuUrl.length > 0 ? splitQuyuUrl : ['c0'],
      splitJiedaoUrl,
      splitDanjiaUrl.length > 0 ? splitDanjiaUrl : ['e0'],
      splitZongjiaUrl.length > 0 ? splitZongjiaUrl : ['f0'],
      splitHuxingUrl,
      splitMianjiUrl,
      splitXiaoshouzhuangtaiUrl.length > 0 ? splitXiaoshouzhuangtaiUrl : ['i0'],
      splitWuyeleixingUrl.length > 0 ? splitWuyeleixingUrl : ['j0'],
      splitKaipanshijianUrl.length > 0 ? splitKaipanshijianUrl : ['k0'],
      splitZhuangxiuzhuangkuangUrl.length > 0
        ? splitZhuangxiuzhuangkuangUrl
        : ['l0'],
      splitLoupanleixingUrl,
      splitLoupanpaixuUrl
    )
    
    // 删除部分路径
    function removeHref(obj) {
      let nowHref = '/lpcx/'
      let splitParamsUrl = ctx.params.search ? ctx.params.search.split('-') : []
      splitParamsUrl.forEach((item,index) => {
        if (item == obj.aliases) {
          splitParamsUrl.splice(index, 1)
        }
      })
      obj.href = nowHref + splitParamsUrl.join('-')
      // 如果删除区域街道也将删除
      if (obj.aliases.charAt(0) == 'c') {
        splitParamsUrl.forEach((item,index) => {
          if (item.charAt(0) == 'd') {
            splitParamsUrl.splice(index, 1)
          }
        })
        obj.href = nowHref + splitParamsUrl.join('-')
        return obj
      }
      return obj
    }

    // 获取区域
    var getRegion = await u.http({
      url: '/app/district/queryDistrictByCityId',
      params: {
        cityId: cityCode,
      },
    })
    if (getRegion.code == 200) {
      // 添加全部
      getRegion.data.unshift({
        id: '',
        lat: '',
        lng: '',
        name: '全部',
        pinyin: '',
        shortName: '全部',
        streetList: [],
        aliases: 'c0',
      })
      // 循环区域
      let nowHeadQuyuName = []
      let nowHeadJiedaoName = []
      getRegion.data.forEach((item) => {
        item.href = setHref(item) // 设置跳转路径
        splitQuyuUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadQuyuName.push(item.shortName)
            screenedData.push(removeHref(item))
            return false
          }
        })
        // 获取当前街道
        splitPageUrl.forEach((v) => {
          if (v == item.aliases) {
            // 循环街道
            item.streetList.forEach((ite) => {
              splitJiedaoUrl.forEach((v) => {
                if (ite.aliases == v) {
                  nowHeadJiedaoName.push(ite.shortName)
                  screenedData.push(ite)
                  return false
                }
              })
              ite.href = setHref(ite)
            })
            streetList = item.streetList
            return false
          }
        })
      })
      regionList = getRegion.data
      headQuyuName = nowHeadQuyuName.join('_')
      headJiedaoName = nowHeadJiedaoName.join('_')
    }

    // 获取地铁
    var getMetro = await u.http({
      url: '/app/metro/queryMetroInfoByCityId',
      params: {
        cityId: cityCode,
      },
    })
    let nowHeadDitieName = []
    if (getMetro.code == 200) {
      getMetro.data.forEach((item) => {
        item.name = item.lineName
        item.href = setHref(item)
        splitDitieUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadDitieName.push(item.lineName)
            screenedData.push(removeHref(item))
            return false
          }
        })
      })
      metroList = getMetro.data
      headDitieName = nowHeadDitieName.join('_')
    }

    // 获取单价
    var getUnitPrice = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 409,
      },
    })
    var nowHeadDanjiaName = []
    if (getUnitPrice.code == 200) {
      // 添加全部
      getUnitPrice.data.unshift({
        name: '全部',
        content: '',
        aliases: 'e0',
      })
      getUnitPrice.data.forEach((item) => {
        item.href = setHref(item)
        splitDanjiaUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadDanjiaName.push(item.name)
            screenedData.push(removeHref(item))
            return false
          }
        })
      })
      priceList = getUnitPrice.data
      headDanjiaName = nowHeadDanjiaName.join('_')
    }

    // 获取总价
    var getTotalPrice = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 408,
      },
    })
    let nowHeadZongjiaName = []
    if (getTotalPrice.code == 200) {
      // 添加全部
      getTotalPrice.data.unshift({
        name: '全部',
        content: '',
        aliases: 'f0',
      })
      getTotalPrice.data.forEach((item) => {
        item.href = setHref(item)
        splitZongjiaUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadZongjiaName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
      })
      priceTotalList = getTotalPrice.data
      headZongjiaName = nowHeadZongjiaName.join('_')
    }

    // 获取户型
    var getHouseType = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 410,
      },
    })
    let nowHeadHuxingName = []
    if (getHouseType.code == 200) {
      getHouseType.data.forEach((item) => {
        splitHuxingUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadHuxingName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
        item.href = setHref(item)
      })
      houseTypeList = getHouseType.data
      headHuxingName = nowHeadHuxingName.join('_')
    }

    // 获取面积
    var getArea = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 413,
      },
    })
    let nowHeadMianjiName = []
    if (getArea.code == 200) {
      getArea.data.forEach((item) => {
        splitMianjiUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadMianjiName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
        item.href = setHref(item)
      })
      areaList = getArea.data
      headMianjiName = nowHeadMianjiName.join('_')
    }

    // 获取销售状态
    var getSalesStatus = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 421,
      },
    })
    let nowHeadXiaoshouzhuangtaiName = []
    if (getSalesStatus.code == 200) {
      // 添加全部
      getSalesStatus.data.unshift({
        name: '全部',
        content: '',
        aliases: 'i0',
      })
      getSalesStatus.data.forEach((item) => {
        item.href = setHref(item)
        splitXiaoshouzhuangtaiUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadXiaoshouzhuangtaiName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
      })
      saleStateList = getSalesStatus.data
      headXiaoshouzhuangtaiName = nowHeadXiaoshouzhuangtaiName.join('_')
    }

    // 获取物业类型
    var getPropertyType = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 414,
      },
    })
    let nowHeadWuyeleixingName = []
    if (getPropertyType.code == 200) {
      // 添加全部
      getPropertyType.data.unshift({
        name: '全部',
        content: '',
        aliases: 'j0',
      })
      getPropertyType.data.forEach((item) => {
        item.href = setHref(item)
        splitWuyeleixingUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadWuyeleixingName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
      })
      propertyTypeList = getPropertyType.data
      headWuyeleixingName = nowHeadWuyeleixingName.join('_')
    }

    // 获取开盘时间
    var getOpeningTime = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 419,
      },
    })
    let nowHeadKaipanshijianName = []
    if (getOpeningTime.code == 200) {
      // 添加全部
      getOpeningTime.data.unshift({
        name: '全部',
        content: '',
        aliases: 'k0',
      })
      getOpeningTime.data.forEach((item) => {
        item.href = setHref(item)
        splitKaipanshijianUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadKaipanshijianName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
      })
      openingTimeList = getOpeningTime.data
      headKaipanshijianName = nowHeadKaipanshijianName.join('_')
    }

    // 获取装修状况
    var getDecorationStatus = await u.http({
      url: '/app/cfg/queryCfgDataByCmid',
      params: {
        cmId: 412,
      },
    })
    let nowHeadZhuangxiuzhuangkuangName = []
    if (getDecorationStatus.code == 200) {
      // 添加全部
      getDecorationStatus.data.unshift({
        name: '全部',
        content: '',
        aliases: 'l0',
      })
      getDecorationStatus.data.forEach((item) => {
        item.href = setHref(item)
        splitZhuangxiuzhuangkuangUrl.forEach((ite) => {
          if (item.aliases == ite) {
            nowHeadZhuangxiuzhuangkuangName.push(item.name)
            screenedData.push(removeHref(item))
          }
        })
      })
      renovationList = getDecorationStatus.data
      headZhuangxiuzhuangkuangName = nowHeadZhuangxiuzhuangkuangName.join('_')
    }

    // 全部楼盘 优惠楼盘
    realEstateTypeData.forEach((item) => {
      item.href = setHref(item)
    })

    // 楼盘排序
    realEstateSortData.forEach((item) => {
      item.href = setHref(item)
    })

    // 获取人气榜
    var getPopularity = await u.http({
      url: '/pc/ranking/queryRankingList',
      params: {
        pageNum: 1,
        pageSize: 3,
        type: 2,
        cityCode,
      },
    })
    if (getPopularity.code == 200) {
      popularityListData = getPopularity.data.list
    }

    // 获取热议榜
    var getHotDiscussion = await u.http({
      url: '/pc/ranking/queryRankingList',
      params: {
        pageNum: 1,
        pageSize: 3,
        type: 1,
        cityCode,
      },
    })
    if (getHotDiscussion.code == 200) {
      hotDiscussionListData = getHotDiscussion.data.list
    }

    // 获取销售榜
    var getSale = await u.http({
      url: '/pc/ranking/queryRankingList',
      params: {
        pageNum: 1,
        pageSize: 3,
        type: 3,
        cityCode,
      },
    })
    if (getSale.code == 200) {
      saleListData = getSale.data.list
    }

    // 猜你喜欢
    var getYouLike = await u.http({
      url: '/app/houseInfo/queryHouseInfoListByHomePage',
      params: {
        cityCode,
        userId: '',
        pageSize: 5,
      },
    })
    if (getYouLike.code == 200) {
      likeListData = getYouLike.data.homePageList.list
    }

    // 获取楼盘
    var getListData = await u.http({
      url: '/pc/houseInfo/queryHouseInfo',
      params: {
        host: ctx.req.headers.host,
        pathUrlStr: ctx.params.search,
        labStr,
        cityCode,
        kwname: searchName,
        pageNum,
        pageSize,
        userId: '',
      },
    })
    if (getListData.code == 200) {
      total = getListData.data.total
      listData = getListData.data.list
      if (getListData.data.list.length < 1) {
        empty = true
      }
    } else {
      empty = true
    }
    // 修饰分隔符
    headJiedaoName = headJiedaoName ? `、${headJiedaoName}` : ''
    headDanjiaName = headDanjiaName ? `、${headDanjiaName}` : ''
    headZongjiaName = headZongjiaName ? `、${headZongjiaName}` : ''
    headHuxingName = headHuxingName ? `、${headHuxingName}` : ''
    headMianjiName = headMianjiName ? `、${headMianjiName}` : ''
    headXiaoshouzhuangtaiName = headXiaoshouzhuangtaiName
      ? `、${headXiaoshouzhuangtaiName}`
      : ''
    headWuyeleixingName = headWuyeleixingName ? `、${headWuyeleixingName}` : ''
    headKaipanshijianName = headKaipanshijianName
      ? `、${headKaipanshijianName}`
      : ''
    headZhuangxiuzhuangkuangName = headZhuangxiuzhuangkuangName
      ? `、${headZhuangxiuzhuangkuangName}`
      : ''
    // 修改页面SEO
    let cityName = currentCity.cityName
    head.title = `${cityName}${headDitieName}${headQuyuName}${headJiedaoName}${headDanjiaName}${headZongjiaName}${headHuxingName}${headMianjiName}${headXiaoshouzhuangtaiName}${headWuyeleixingName}${headKaipanshijianName}${headZhuangxiuzhuangkuangName}楼盘_${cityName}新房价格查询-${cityName}✖✖✖✖✖✖✖✖✖✖`
    head.keywords = `${cityName}新房,${cityName}楼盘,${cityName}在售开盘信息,${cityName}房价查询`
    head.content = `${cityName}✖✖✖✖✖✖✖✖✖✖，为您提供${cityName}新房，${cityName}新开楼盘，${cityName}新房房源信息。让您及时了解${cityName}新房楼盘房价价格趋势及${cityName}楼盘周边配套信息.`
    // 修改seo
    crumbListData = [
      {
        title: `${currentCity.cityName}✖✖✖✖✖✖✖✖✖✖`,
        href: prefixUrl,
      },
      {
        title: `${currentCity.cityName}楼盘列表`,
        href: `${prefixUrl}/lpcx/`,
      },
    ]
    if (headQuyuName) {
      crumbListData.push({
        title: `${headQuyuName}楼盘`,
        href: `${prefixUrl}/lpcx/${splitQuyuUrl[0]}`,
      })
    }
    // 楼盘分类a-z
    let getQueryHouseByLetterGroup = await u.http({
      url: '/pc/houseInfo/queryHouseByLetterGroup',
      params: {
        cityCode: ctx.cityCode
      }
    })
    if (getQueryHouseByLetterGroup.code == 200) {
      lpflData = getQueryHouseByLetterGroup.data
    }

    return {
      prefixUrl,
      currentCity,
      cityList,
      crumbListData,
      positionMenu: splitDitieUrl.length > 0 ? 1 : 0,
      regionList,
      streetList,
      metroList,
      priceList,
      priceTotalList,
      houseTypeList,
      areaList,
      saleStateList,
      propertyTypeList,
      openingTimeList,
      renovationList,
      popularityListData,
      hotDiscussionListData,
      saleListData,
      likeListData,
      realEstateTypeData,
      realEstateSortData,
      splitPageUrlArr,
      realEstateTypeChecked: splitLoupanleixingUrl.join(',') || 'm0',
      realEstateSortChecked: splitLoupanpaixuUrl.join(',') || 'n0',
      pageNum:
        splitFenyeUrl.length > 0
          ? Number(splitFenyeUrl.join(',').split('p')[1])
          : 1, // 修改分页
      pageSize,
      total,
      listData,
      empty,
      screenedData,
      lpflData,
    }
  },
  mounted() {
    // 修改分页标签
    this.updatePageList()
    // 重新渲染更多 收起
    // let getMore = localStorage.getItem("more");
    // let defaultMore = {
    //   show: false,
    //   title: "更多",
    //   icon: "el-icon-arrow-down",
    // };
    // this.more = getMore ? JSON.parse(getMore) : defaultMore;
  },
  methods: {
    // 分页追加A标签
    updatePageList() {
      // 获取参数路径
      let splitPathname = location.pathname.split('/')
      let pathnameLen = splitPathname.length > 0 ? splitPathname.length - 1 : 0
      let params = splitPathname[pathnameLen]
      let splitParams = params.split('-') // 拆分参数路径 重组路径
      let search = location.search
        ? `?kwname=${location.search.split('&')[0].split('?kwname=')[1]}`
        : ''
      // 循环分页标签添加a标签
      let lidoc = document.querySelectorAll('.page-row .el-pager li')
      lidoc.forEach((item, index) => {
        let nowParams = 'javascript:void(0)'
        if (item.innerText) {
          if (item.innerText > 1) {
            let itemArr = [`p${item.innerText}`]
            nowParams =
              `${this.prefixUrl}/lpcx/` + this.repUrl(splitParams, itemArr)
          } else {
            nowParams = `${this.prefixUrl}/lpcx/` + this.repUrl(splitParams, [])
          }
        }
        item.innerHTML = `<a href="${
          nowParams + search
        }" style="display: block">${item.innerHTML}</a>`
      })
    },
    // 将两个数组合并新路径参数
    repUrl(arr, pageArr) {
      arr.forEach((item, index) => {
        if (/\p[1-9]\d*/.exec(item)) {
          arr.splice(index, 1)
        }
      })
      let nowArr = u.emptyArrayIsNull(arr.concat(pageArr))
      return nowArr.join('-')
    },
    // 筛选选中
    setChecked(arr, aliases) {
      let flag = false
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] == aliases) {
          flag = true
          break
        }
      }
      return flag
    },
    // 更多 收起
    // moreChange() {
    //   this.more.title = this.more.show ? "更多" : "收起";
    //   this.more.icon = this.more.show
    //     ? "el-icon-arrow-down"
    //     : "el-icon-arrow-up";
    //   this.more.show = !this.more.show;
    //   // 保存更多 收起状态
    //   localStorage.setItem("more", JSON.stringify(this.more));
    // },
    // 分页发生改变
    pageChange(e) {
      let repVal = /\p[1-9]\d*/.exec(location.href)
        ? /\p[1-9]\d*/.exec(location.href)[0]
        : ''
      let nowHref =
        e > 1
          ? location.href.replace(repVal, `p${e}`)
          : location.href.replace(repVal, '')
      location.href = nowHref
    },
  },
}
</script>